<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <title>伤害测试</title>
      <link rel="stylesheet" href="../css/reset.css">
      <link rel="stylesheet" href="../css/index.css">
      <link rel="stylesheet" href="../layer/mobile/need/layer.css">
      <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
      <style type="text/css">
         #app {
            height: 100vh;
            display: flex;
         }

         .el-container {
            overflow: hidden;
            height: 100vh;
         }

         .el-main {
            padding: 10px;
         }

         .cont {
            display: flex;
            align-items: flex-start;
            border-bottom: 1px solid #cdcdcd;
         }

         ._cont_left {
            width: 50%;
            height: 100%;
         }

         ._cont_right {
            width: 50%;
            height: 100%;
            border-left: 1px solid #DCDFE6;
         }

         .cont_item ._item_top {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            flex-wrap: wrap;
            height: 219px;
            position: relative;
         }

         .cont_item ._item_top ._item_btn {
            width: 100%;
            padding: 0 15px;
            box-sizing: border-box;
            position: absolute;
            bottom: 0;
         }

         .padding_left {
            padding-left: 10px;
         }

         .cont_item ._item_img {
            width: 140px;
            text-align: center;
         }

         .cont_item ._item_img ._img {
            margin-top: 20px;
            border-radius: 4px;
         }

         .cont_item ._item_img p {
            margin-top: 20px;
            font-size: 18px;
            color: #000000;
            margin-bottom: 20px;
         }

         ._item_info {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            padding-top: 15px;
            flex: 1;
         }

         .el-input--mini {
            width: 120px;
         }

         ._item_info ._info_item {
            width: 50%;
            padding: 5px;
            display: flex;
            align-items: center;
         }

         .cont_item ._cont_title {
            margin-top: 10px;
            font-size: 20px;
            color: #000000;
         }

         .cont_item ._cont_item {
            padding: 5px 0;
         }

         .cont_item ._cont_item span {
            padding: 0 5px;
         }

         .cont_item ._cont_item ._item_xw {
            width: 110px;
         }

         .cont_item ._item_bottom ._bottom_title {
            margin-top: 10px;
            font-size: 20px;
            color: #000000;
         }

         .cont_item ._item_bottom ._bottom_box {
            display: flex;
            flex-wrap: wrap;
         }

         ._bottom_box ._bottom_panel {
            width: 40%;
         }

         ._panel {
            flex: 1;
         }

         ._bottom_box ._bottom_panel ._panel_item {
            font-size: 16px;
         }

         ._bottom_box ._bottom_panel ._panel_item span {
            padding: 0 5px;
         }

         ._bottom_box ._panel_element {
            display: block;
            width: 100%;
            margin-top: 5px;
         }

         ._bottom_box ._panel_element span {
            margin: 5px;
         }

         .cont_item ._item_skill {
            margin-top: 10px;
         }

         .cont_item ._item_skill ._skill_title {
            font-size: 20px;
            color: #000000;
         }

         .cont_item ._item_skill ._skill_list {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: wrap;
            margin-top: 10px;
         }

         .cont_item ._item_skill ._skill_item {
            margin-right: 10px;
            margin-bottom: 10px;
         }

         .cont_item ._item_skill ._skill_item img {
            width: 74px;
            height: 74px;
            border-radius: 4px;
         }

         .grid-content {
            border-radius: 4px;
            min-height: 36px;
            width: 74px;
            height: 74px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f9fafc;
            margin-bottom: 20px;
            cursor: pointer;
         }

         .grid-content img {
            width: 74px;
            height: 74px;
            border-radius: 4px;
         }

         .grid-content i {
            font-size: 28px;
         }

         .el-row {
            margin-bottom: 20px;
            width: 100%;
         }

         .el-row:last-child {
            margin-bottom: 0;
         }

         .el-col {
            border-radius: 4px;
         }

         .skills_box {
            padding: 20px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: wrap;
         }

         .skills_box .box_item {
            width: 74px;
            text-align: center;
            cursor: pointer;
            margin: 10px;
         }

         .skills_box .box_item img {
            width: 74px;
            height: 74px;
            border-radius: 4px;
         }

         .skills_box .box_item p {
            font-size: 14px;
         }

         /* 结果 */
         .result {
            border-left: 1px solid #f5f5f5;
            box-sizing: border-box;
            padding: 10px 0;
         }

         ::-webkit-scrollbar {
            width: 5px;
            height: 1px;
         }

         ::-webkit-scrollbar-thumb {
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #535353;
         }

         ::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 5px;
            background: #EDEDED;
         }

         .result_item {
            padding: 5px;
            font-size: 14px;
            color: #303133;
         }

         .item_box {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: wrap;
         }

         .item_box ._item_die {
            width: 100%;
         }

         .item_box ._item_die span {
            color: #814735;
            font-size: 16px;
            padding: 0 5px;
         }

         ._item_name1 {
            color: #409EFF;
            font-size: 16px;
            padding: 0 5px;
         }

         ._item_name2 {
            color: #E6A23C;
            font-size: 16px;
            padding: 0 5px;
         }

         ._item_hurt {
            color: #F56C6C;
            font-size: 16px;
            padding: 0 5px;
            font-weight: bold;
         }

         ._item_cart {
            color: red;
            font-size: 16px;
         }

         ._item_jn {
            color: #6e00ff;
            font-size: 16px;
         }

         ._item_leech {
            color: #ff0076;
            font-size: 14px;
            margin: 0 5px;
            font-weight: bold;
         }

         ._item_block {
            color: #000000;
            font-size: 14px;
            font-weight: bold;
         }

         ._item_holyPressure {
            color: #823b3d;
            font-size: 14px;
         }
      </style>
   </head>
   <body>
      <div id="app" class="hide">
         <el-container>
            <el-main>
               <div class="cont">
                  <div class="cont_item _cont_left">
                     <div class="_item_top">
                        <div class="_item_img">
                           <img class="_img" :src="'.' + infoData.image" alt="infoData.rename">
                           <p class="_item_name">名称：{{infoData.rename}}</p>
                        </div>
                        <div class="_item_info">
                           <div class="_info_item">等级：{{infoData.grade}}</div>
                           <div class="_info_item">成长：{{infoData.cz}}</div>
                           <div class="_info_item">体：{{infoData.ti}}</div>
                           <div class="_info_item">气血：{{infoData.sm}}</div>
                           <div class="_info_item">耐：{{infoData.nai}}</div>
                           <div class="_info_item">物攻：{{infoData.wg}}</div>
                           <div class="_info_item">灵：{{infoData.ling}}</div>
                           <div class="_info_item">灵力：{{infoData.ll}}</div>
                           <div class="_info_item">力：{{infoData.li}}</div>
                           <div class="_info_item">物防：{{infoData.wf}}</div>
                           <div class="_info_item">敏：{{infoData.min}}</div>
                           <div class="_info_item">速度：{{infoData.sd}}</div>
                        </div>
                     </div>
                     <el-divider></el-divider>
                     <div class="_item_cont">
                        <div class="_cont_title">
                           修为:
                        </div>
                        <div class="_cont_item">
                           人物境界：<span>{{boundary[infoData.realm].name + '-' + boundary[infoData.realm].up + '%'}}</span>
                        </div>
                        <div class="_cont_item">
                           宠物修炼：伤害:<span>{{practice[infoData.etc_sh].name + '-' + practice[infoData.etc_sh].up + '%'}}</span>物防:<span>{{practice[infoData.etc_wf].name + '-' + practice[infoData.etc_wf].up + '%'}}</span>法防:<span>{{practice[infoData.etc_ff].name + '-' + practice[infoData.etc_ff].up + '%'}}</span>
                        </div>
                     </div>
                     <div class="_item_bottom">
                        <div class="_bottom_title">
                           面板:
                        </div>
                        <div class="_bottom_box">
                           <div class="_bottom_panel">
                              <div class="_panel_item">
                                 气血:<span>{{qixie}}</span>
                              </div>
                              <div class="_panel_item">
                                 法防:<span>{{fafang}}</span>
                              </div>
                              <div class="_panel_item">
                                 物攻:<span>{{wugong}}</span>
                              </div>
                              <div class="_panel_item">
                                 物防:<span>{{wufang}}</span>
                              </div>
                              <div class="_panel_item">
                                 法攻:<span>{{fashang}}</span>
                              </div>
                              <div class="_panel_item">
                                 速度:<span>{{sudu}}</span>
                              </div>
                              <div class="_panel_item">
                                 物理结果:<span>{{infoData.adUp}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术结果:<span>{{infoData.apUp}}%</span>
                              </div>
                           </div>
                           <div class="_bottom_panel _panel">
                              <div class="_panel_item">
                                 物理穿透:<span>{{infoData.wc}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术穿透:<span>{{infoData.fc}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理暴击:<span>{{infoData.critWb}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术暴击:<span>{{infoData.critFb}}%</span>
                              </div>
                              <div class="_panel_item">
                                 暴击躲避:<span>{{infoData.elude}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理减免:<span>{{infoData.adImmune}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术减免:<span>{{infoData.apImmune}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理吸血:<span>{{infoData.leech}}%</span>
                              </div>
                           </div>
                           <div class="_panel_item _panel_element">
                              元素亲和:<span>火:{{infoData.huo_element}}</span><span>冰:{{infoData.bing_element}}</span><span>电:{{infoData.dian_element}}</span><span>毒:{{infoData.du_element}}</span><span>水:{{infoData.shui_element}}</span>
                           </div>
                        </div>
                     </div>
                     <div class="_item_skill">
                        <div class="_skill_title">
                           技能:
                        </div>
                        <div class="_skill_list">
                           <el-row :gutter="20">
                              <el-col :span="4" v-for="(item,index) in infoData.skills" :key="index"
                                 @click="checkSkill">
                                 <div class="grid-content bg-purple">
                                    <img :src="'.' + item.src" alt="">
                                 </div>
                              </el-col>
                           </el-row>
                           <!-- <div class="_skill_item" v-for="(item,index) in infoData.skills" :key="index">
                              <img :src="'.' + item.src" :alt="item.name">
                           </div> -->
                        </div>
                     </div>
                  </div>
                  <div class="cont_item _cont_right">
                     <div class="_item_top">
                        <div class="_item_img">
                           <img class="_img" :src="'.' + infoData2.image" alt="infoData2.rename">
                           <p class="_item_name">目标：{{infoData2.rename}}</p>
                        </div>
                        <div class="_item_info">
                           <div class="_info_item">气血：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.qixie"></el-input>
                           </div>
                           <div class="_info_item">物防：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.wufang"></el-input>
                           </div>
                           <div class="_info_item">物攻：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.wugong"></el-input>
                           </div>
                           <div class="_info_item">法攻：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.fashang"></el-input>
                           </div>
                           <div class="_info_item">法防：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.fafang"></el-input>
                           </div>
                           <div class="_info_item">速度：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.sudu"></el-input>
                           </div>
                           <div class="_info_item">火亲：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.huo_element"></el-input>
                           </div>
                           <div class="_info_item">冰亲：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.bing_element"></el-input>
                           </div>
                           <div class="_info_item">电亲：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.dian_element"></el-input>
                           </div>
                           <div class="_info_item">毒亲：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.du_element"></el-input>
                           </div>
                           <div class="_info_item">水亲：
                              <el-input size="mini" placeholder="请输入内容" v-model="infoData2.shui_element"></el-input>
                           </div>
                        </div>
                        <div class="_item_btn">
                           <el-button type="primary" @click="begin">测试开始</el-button>
                        </div>
                     </div>
                     <el-divider></el-divider>
                     <div class="_item_cont padding_left">
                        <div class="_cont_title">
                           修为:
                        </div>
                        <div class="_cont_item">
                           人物境界：
                           <el-select size="small" v-model="infoData2.realm" placeholder="请选择">
                              <el-option v-for="(item,index) in boundary" :key="index"
                                 :label="item.name + '-' + item.up + '%'" :value="index">
                              </el-option>
                           </el-select>
                        </div>
                        <div class="_cont_item">
                           宠物修炼：
                           伤害:
                           <el-select size="small" class="_item_xw" v-model="infoData2.etc_sh" placeholder="请选择">
                              <el-option v-for="(item,index) in practice" :key="index"
                                 :label="item.name + '-' + item.up + '%'" :value="index">
                              </el-option>
                           </el-select>
                           物防:
                           <el-select size="small" class="_item_xw" v-model="infoData2.etc_wf" placeholder="请选择">
                              <el-option v-for="(item,index) in practice" :key="index"
                                 :label="item.name + '-' + item.up + '%'" :value="index">
                              </el-option>
                           </el-select>
                           法防:
                           <el-select size="small" class="_item_xw" v-model="infoData2.etc_ff" placeholder="请选择">
                              <el-option v-for="(item,index) in practice" :key="index"
                                 :label="item.name + '-' + item.up + '%'" :value="index">
                              </el-option>
                           </el-select>
                        </div>
                     </div>
                     <div class="_item_bottom padding_left">
                        <div class="_bottom_title">
                           面板:
                        </div>
                        <div class="_bottom_box">
                           <div class="_bottom_panel">
                              <div class="_panel_item">
                                 气血:<span>{{qixie2}}</span>
                              </div>
                              <div class="_panel_item">
                                 法防:<span>{{infoData2.fafang}}</span>
                              </div>
                              <div class="_panel_item">
                                 物攻:<span>{{infoData2.wugong}}</span>
                              </div>
                              <div class="_panel_item">
                                 物防:<span>{{infoData2.wufang}}</span>
                              </div>
                              <div class="_panel_item">
                                 法攻:<span>{{infoData2.fashang}}</span>
                              </div>
                              <div class="_panel_item">
                                 速度:<span>{{sudu2}}</span>
                              </div>
                              <div class="_panel_item">
                                 物理结果:<span>{{infoData2.adUp}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术结果:<span>{{infoData2.apUp}}%</span>
                              </div>
                           </div>
                           <div class="_bottom_panel _panel">
                              <div class="_panel_item">
                                 物理穿透:<span>{{infoData2.wc}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术穿透:<span>{{infoData2.fc}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理暴击:<span>{{infoData2.critWb}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术暴击:<span>{{infoData2.critFb}}%</span>
                              </div>
                              <div class="_panel_item">
                                 暴击躲避:<span>{{infoData2.elude}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理减免:<span>{{infoData2.adImmune}}%</span>
                              </div>
                              <div class="_panel_item">
                                 法术减免:<span>{{infoData2.apImmune}}%</span>
                              </div>
                              <div class="_panel_item">
                                 物理吸血:<span>{{infoData2.leech}}%</span>
                              </div>
                           </div>
                           <div class="_panel_item _panel_element">
                              元素亲和:<span>火:{{infoData2.huo_element}}</span><span>冰:{{infoData2.bing_element}}</span><span>电:{{infoData2.dian_element}}</span><span>毒:{{infoData2.du_element}}</span><span>水:{{infoData2.shui_element}}</span>
                           </div>
                        </div>
                     </div>
                     <div class="_item_skill padding_left">
                        <div class="_skill_title">
                           技能:
                        </div>
                        <div class="_skill_list">
                           <el-row :gutter="20">
                              <el-col :span="4" v-for="(item,index) in infoData2.skills" :key="index"
                                 @click="checkSkill">
                                 <el-tooltip class="item" effect="dark" content="点击删除" placement="top-start">
                                    <div class="grid-content bg-purple" @click="deleteSkill(item,index)">
                                       <img :src="'.' + item.src" alt="">
                                    </div>
                                 </el-tooltip>
                              </el-col>
                              <el-col :span="4" v-if="infoData2.skills.length < infoData2.skill + 2">
                                 <div class="grid-content bg-purple" @click="addSkill">
                                    <i class="el-icon-plus"></i>
                                 </div>
                              </el-col>
                           </el-row>
                        </div>
                     </div>
                  </div>
               </div>
               <div class="result">
                  <div class="result_item" v-for="(item,index) in details" :key="index">
                     <div class="item_box _item_case1">
                        <span class="_item_name1">{{item.name1}}</span>对
                        <span class="_item_name2">{{item.name2}}</span>使用
                        <span class="_item_jn">{{item.skillname}}</span>
                        <span class="_item_cart" v-if="item.wulian == 1">连击!</span>
                        <span class="_item_cart" v-if="item.baoji == 1">暴击!</span>
                        <span v-if="item.block">,<span class="_item_name2">{{item.name2}}</span>成功<span
                              class="_item_block">格挡</span>,</span>造成
                        <span class="_item_hurt">{{item.sh}}</span>
                        <span>点<span class="_item_holyPressure" v-if="item.holyPressure">神罚</span>伤害,</span>
                        <span v-if="item.leech">吸收<span class="_item_leech">{{item.leech}}</span>点生命值,<span
                              class="_item_name1">{{item.name1}}</span>当前生命值：<span
                              class="_item_hurt">{{item.smz}}</span>,</span>
                        <span class="_item_name2">{{item.name2}}</span>剩余
                        <span class="_item_hurt">{{item.sm}}</span>点生命值
                        <div class="_item_die" v-if="item.sm <= 0 || item.reborn1">
                           <span>{{item.name2}}</span>死亡!
                           <span v-if="item.reborn1">{{item.name2}}重生!当前生命值:<span>{{item.cssm}}</span></span>
                           <span v-if="item.reborn2">{{item.name2}}重生!当前生命值:<span>{{item.cssm}}</span></span>
                           <span v-if="item.noReborn">不能复活!</span>
                        </div>
                     </div>
                  </div>
               </div>
            </el-main>
         </el-container>
      </div>
   </body>
   <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
   <script src="../js/vue.min.js"></script>
   <script src="../layer/layer.js"></script>
   <script src="https://unpkg.com/element-ui/lib/index.js"></script>
   <script src="../js/pets.json" type="text/javascript" charset="utf-8"></script>
   <script src="../js/skills.json" type="text/javascript" charset="utf-8"></script>
   <script src="../js/boundary.json" type="text/javascript" charset="utf-8"></script>
   <script src="../js/practice.json" type="text/javascript" charset="utf-8"></script>
   <script type="text/javascript">
      let tableData = localStorage.getItem('tableData') ? JSON.parse(localStorage.getItem('tableData')) : [];
      let oldQixue1 = 0;
      let oldQixue2 = 0;
      let isAttack = true; //是否先手
      let isCrit = false; //是否暴击
      let isBlock = false; //是否格挡
      let rebornNumber1 = 0; //宠物1重生次数
      let rebornNumber2 = 0; //宠物2重生次数
      let huo_element = 0;
      let bing_element = 0;
      let dian_element = 0;
      let du_element = 0;
      let shui_element = 0;
      var app = new Vue({
         el: "#app",
         data: {
            pets: pets,
            infoData: {},
            infoData2: {
               image: "./image/yulaosan.jpg",
               name: "鱼老三",
               rename: "鱼老三",
               qixie: 4800,
               fashang: 1005,
               fafang: 799,
               wugong: 1772,
               wufang: 908,
               sudu: 770,
               wc: 0,
               critWb: 2,
               critFb: 2,
               elude: 0,
               sdUp: 0,
               adUp: 0,
               apUp: 0,
               smUp: 0,
               fqUp: 0, //法强提升
               skill: 6,
               leech: 0,
               skill: 6,
               skills: [],
               isWl: 0, //物连几率
               realm: 0,
               shui_element: 0,
               huo_element: 0,
               bing_element: 0,
               du_element: 0,
               dian_element: 0,
               etc_sh: 0,
               etc_wf: 0,
               etc_ff: 0,
               isFl: 0,
               skillAttr: '',
               skillname: '',
               isSj: 0,
               sjMin: 0,
               sjMax: 0,
               fc: 0,
               reborn: 0,
               adImmune: 0,
               apImmune: 0,
               isBlock: 0,
               exclusive: ''
            },
            gameNumber: 0,
            gameNumber2: 0,
            details: [],
            boundary: boundary,
            practice: practice,
            index: 0,
            randomMin: -5,
            randomMax: 5,
         },
         computed: {
            qixie() {
               var result = Math.round(50 + this.infoData.sm * this.infoData.grade * 10 / 1000 + this.infoData
                  .ti * 3 * this.infoData.cz);
               result = Math.round(parseInt(result) * (100 + this.infoData.smUp) / 100) + parseInt(this.infoData
                  .by_sm);
               this.infoData.qixieHide = result;
               return result;
            },
            qixie2() {
               var result = JSON.parse(JSON.stringify(this.infoData2.qixie));
               result = Math.round(parseInt(result) * (100 + this.infoData2.smUp) / 100);
               this.infoData2.qixieHide = result;
               return result;
            },
            fashang() {
               var result = Math.round((this.infoData.ling * 0.5 + this.infoData.li * 0.3 + (parseInt(this
                     .infoData.ti) + parseInt(this.infoData.nai)) * 0.1) * this.infoData.cz + this.infoData
                  .grade * this.infoData.ll / 1000 * 1.425 + 80) + parseInt(this.infoData.by_fs) + Math.round(
                  this.infoData.fqUp * this.infoData.ling / 100);
               this.infoData.fashang = result;
               return result
            },
            fafang() {
               var result = Math.round((this.infoData.ling * 0.5 + this.infoData.li * 0.3 + (parseInt(this
                     .infoData.ti) + parseInt(this.infoData.nai)) * 0.1) * this.infoData.cz + this.infoData
                  .grade * this.infoData.ll / 1000 * 0.62) + parseInt(this.infoData.by_ff);
               this.infoData.fafang = result;
               return result
            },
            wugong() {
               var result = Math.round(this.infoData.wg * 5 * this.infoData.grade / 1000 + this.infoData.li * this
                  .infoData.cz * 0.5 + 100) + parseInt(this.infoData.by_wg);
               this.infoData.wugong = result;
               return result;
            },
            wufang() {
               var result = Math.round(parseInt(this.infoData.nai * this.infoData.cz) + this.infoData.wf * this
                  .infoData.grade * 3.33 / 1000) + parseInt(this.infoData.by_wf);
               this.infoData.wufang = result;
               return result
            },
            sudu() {
               var result = Math.round(((parseInt(this.infoData.ti) + parseInt(this.infoData.li) + parseInt(this
                     .infoData.nai)) * 0.1 + this.infoData.ling * 0.05 + this.infoData.min * 0.5) * this
                  .infoData.cz + this.infoData.grade * this.infoData.sd * 2.215 / 1000) + parseInt(this
                  .infoData.by_sd);
               result = Math.round(parseInt(result) * (100 + this.infoData.sdUp) / 100);
               this.infoData.sudu = result;
               return result
            },
            sudu2() {
               var result = this.infoData2.sudu;
               result = Math.round(parseInt(result) * (100 + this.infoData2.sdUp) / 100);
               return result
            }
         },
         created() {
            this.index = getUrlParms('index');
            this.infoData = tableData[this.index];
         },
         methods: {
            // 物理伤害计算公式
            hurtRulst(obj1, obj2) {
               console.log(obj1.rename, '物攻：', obj1.wugong, obj2.rename, '物防：', obj2.wufang);
               let random = Math.floor((Math.random() * (this.randomMax - this.randomMin + 1)) + this
                  .randomMin); //伤害浮动
               var difference = Math.floor(obj1.wugong - obj2.wufang * (100 - obj1.wc) / 100); //攻防差
               var crit = Math.floor(Math.random() * 100 + 1) <= (obj1.critWb - obj2.elude) ? true :
                  false; //暴击随机数判断
               if (difference <= obj1.wugong * 0.15) {
                  difference = (obj1.wugong * 0.15) * obj1.wugong / (obj2.wufang * (100 - obj1.wc) / 100); //未破防
               }
               // var realmHurt = Math.round(difference * (100  ) / 100); //境界伤害差距
               var realmHurt = difference //去掉境界
               let holySh = 0;
               let elementSh = 0;
               if (obj1.holyPressure > 0 && obj2.reborn > 0) {
                  holySh = obj1.holyPressure;
               }
               if (obj1.skillAttr) {
                  elementSh = obj1[obj1.skillAttr] - obj2[obj1.skillAttr];
               }
               var additionHurt = Math.round(realmHurt * (100 + this.boundary[obj1.realm].up + obj1.adUp +
                     holySh + elementSh + this.practice[obj1.etc_sh].up - this.boundary[obj2.realm].up - this
                     .practice[obj2.etc_wf].up - obj2.adImmune) / 100 + this.practice[obj1.etc_sh].etc - this
                  .practice[obj2.etc_wf].etc); //伤害加成计算
               // var additionHurt = Math.round(realmHurt * (100 * this.boundary[obj1.realm].up * obj1.adUp *
               //       holySh * elementSh * this.practice[obj1.etc_sh].up / this.boundary[obj2.realm].up / this
               //       .practice[obj2.etc_wf].up / obj2.adImmune) / 100 + this.practice[obj1.etc_sh].etc - this
               //    .practice[obj2.etc_wf].etc); //伤害加成计算
               if (crit) {
                  isCrit = true;
                  additionHurt += Math.round(realmHurt * (100 + this.boundary[obj1.realm].up + this.practice[obj1
                        .etc_sh].up - this.boundary[obj2.realm].up - this.practice[obj2.etc_wf].up - obj2
                     .adImmune) / 100); //暴击伤害
               } else {
                  isCrit = false;
               }
               console.log('additionHurt', additionHurt)
               var formula = Math.round(additionHurt * (100 + random) / 100); //伤害浮动计算
               if (obj2.isBlock) {
                  isBlock = Math.floor(Math.random() * 100 + 1) <= obj2.isBlock ? true :
                     false; //暴击随机数判断
                  if (isBlock) {
                     formula = Math.round(formula * 0.5);
                  }
               } else {
                  isBlock = false;
               }
               console.log('formula', formula)
               formula = formula <= 0 ? 1 : formula;
               return formula;
            },
            // 法术伤害计算公式
            hurtRulst2(obj1, obj2) {
               let random = Math.floor((Math.random() * (this.randomMax - this.randomMin + 1)) + this
                  .randomMin); //伤害浮动
               var difference = Math.floor((obj1.fashang - obj2.fafang * (100 - obj1.fc) / 100)); //攻防差
               if (difference <= obj1.fashang * 0.15) {
                  difference = (obj1.fashang * 0.15) * obj1.fashang / (obj2.fafang * (100 - obj1.fc) / 100); //未破防
               }
               difference = difference * (1 + (1 - difference / obj1.fashang));
               var crit = Math.floor(Math.random() * 100 + 1) <= (obj1.critFb - obj2.elude) ? true :
                  false; //暴击随机数判断
               // var realmHurt = Math.round(difference * (100 + this.boundary[obj1.realm].up - this.boundary[obj2
               //    .realm].up) / 100); //境界伤害差距
               var realmHurt = difference //去掉境界
               let zhenDang = 0;
               let holySh = 0;
               let elementSh = 0;
               if (obj1.isSj) {
                  zhenDang = Math.floor((Math.random() * (obj1.sjMax - obj1.sjMin + 1)) + obj1.sjMin);
               }
               if (this.infoData.holyPressure > 0 && this.infoData2.reborn > 0) {
                  holySh = this.infoData.holyPressure;
               }
               if (obj1.skillAttr) {
                  elementSh = obj1[obj1.skillAttr] - obj2[obj1.skillAttr];
               }
               var additionHurt = Math.round(realmHurt * (100 + obj1.apUp + zhenDang + holySh + elementSh + this.practice[obj1.etc_sh].up + this.boundary[obj1.realm].up - this.boundary[obj2.realm].up - this.practice[obj2.etc_ff].up - obj2.apImmune) / 100 + this.practice[obj1.etc_sh].etc - this.practice[obj2.etc_ff].etc); //伤害加成计算   
               // var additionHurt = Math.round(realmHurt * (100 * obj1.apUp * zhenDang * holySh * elementSh * this
               //       .practice[obj1.etc_sh].up * this.boundary[obj1.realm].up / this.boundary[obj2.realm].up /
               //       this.practice[obj2.etc_ff].up / obj2.apImmune) / 100 + this.practice[obj1.etc_sh].etc -
               //    this.practice[obj2.etc_ff].etc); //伤害加成计算   
               if (crit) {
                  isCrit = true;
                  additionHurt += Math.round(realmHurt * (100 + this.boundary[obj1.realm].up + this.practice[obj1
                        .etc_sh].up - this.boundary[obj2.realm].up - this.practice[obj2.etc_ff].up - obj2
                     .apImmune) / 100); //暴击伤害
               } else {
                  isCrit = false;
               }
               var formula = Math.round(additionHurt * (100 + random) / 100); //伤害浮动计算
               formula = formula <= 0 ? 1 : formula;
               return formula;
            },
            begin() {
               this.details = [];
               oldQixue1 = this.infoData.qixieHide
               oldQixue2 = this.infoData2.qixieHide
               this.gameNumber = 0;
               this.gameNumber2 = 0;
               if (this.infoData.sudu >= this.sudu2) {
                  isAttack = true;
                  if (this.infoData.skillAttr && this.infoData.skillname) {
                     this.echoResult2();
                  } else {
                     this.echoResult();
                  }
               } else {
                  isAttack = false;
                  if (this.infoData2.skillAttr && this.infoData2.skillname) {
                     this.echoResult2();
                  } else {
                     this.echoResult();
                  }
               }
               setTimeout(() => {
                  $('.el-main').scrollTop(1000);
               }, 100)
            },
            //物理对局详情
            echoResult() {
               if (this.infoData.qixieHide > 0 && this.infoData2.qixieHide > 0) {
                  if (isAttack) {
                     this.gameNumber += 1;
                     if (this.infoData.isWl > 0) {
                        var lianji = Math.floor(Math.random() * 100 + 1) <= this.infoData.isWl ? true :
                           false; //暴击随机数判断
                        if (lianji) {
                           let sh = this.hurtRulst(this.infoData, this.infoData2);
                           let sxNumber = 0;
                           if (this.infoData.leech > 0) {
                              sxNumber = Math.round(sh * this.infoData.leech / 100);
                              this.infoData.qixieHide += sxNumber;
                              this.infoData.qixieHide = this.infoData.qixieHide > oldQixue1 ? oldQixue1 : this
                                 .infoData.qixieHide;
                           }
                           this.infoData2.qixieHide -= sh;
                           let tempJson = {
                              baoji: 0,
                              wulian: 0,
                              skillname: this.infoData.skillname ? this.infoData.skillname : '普攻',
                              name1: this.infoData.rename,
                              name2: this.infoData2.rename,
                              sh: sh,
                              sm: this.infoData2.qixieHide < 0 ? 0 : this.infoData2.qixieHide
                           };
                           if (this.infoData.leech) {
                              tempJson.leech = sxNumber;
                              tempJson.smz = this.infoData.qixieHide;
                           }
                           if (isCrit) {
                              tempJson.baoji = 1;
                           }
                           if (isBlock) {
                              tempJson.block = 1;
                           }
                           if (this.infoData.holyPressure > 0 && this.infoData2.reborn > 0) {
                              tempJson.holyPressure = 1;
                           }
                           this.details.push(tempJson);
                           if (this.infoData2.qixieHide <= 0 && this.infoData2.reborn > 0) {
                              if (this.infoData.holyPressure > 0) {
                                 this.infoData.qixieHide = oldQixue1;
                                 this.infoData2.qixieHide = oldQixue2;
                                 this.details[this.details.length - 1].noReborn = true;
                              } else {
                                 this.isReborn(this.infoData2, this.infoData, 1);
                              }
                              return false;
                           } else if (this.infoData.qixieHide <= 0) {
                              this.infoData.qixieHide = oldQixue1;
                              this.infoData2.qixieHide = oldQixue2;
                              return false;
                           }
                        }
                     }
                     let sh = this.hurtRulst(this.infoData, this.infoData2);
                     let sxNumber = 0;
                     if (this.infoData.leech > 0) {
                        sxNumber = Math.round(sh * this.infoData.leech / 100);
                        this.infoData.qixieHide += sxNumber;
                        this.infoData.qixieHide = this.infoData.qixieHide > oldQixue1 ? oldQixue1 : this.infoData
                           .qixieHide;
                     }
                     this.infoData2.qixieHide -= sh;

                     let tempJson = {
                        baoji: 0,
                        wulian: 0,
                        skillname: this.infoData.skillname ? this.infoData.skillname : '普攻',
                        name1: this.infoData.rename,
                        name2: this.infoData2.rename,
                        sh: sh,
                        sm: this.infoData2.qixieHide < 0 ? 0 : this.infoData2.qixieHide
                     };

                     if (this.infoData.leech) {
                        tempJson.leech = sxNumber;
                        tempJson.smz = this.infoData.qixieHide;
                     }
                     if (isCrit) {
                        tempJson.baoji = 1;
                     }
                     if (lianji) {
                        tempJson.wulian = 1;
                     }
                     if (isBlock) {
                        tempJson.block = 1;
                     }
                     if (this.infoData.holyPressure > 0 && this.infoData2.reborn) {
                        tempJson.holyPressure = 1;
                     }
                     isAttack = false;
                     this.details.push(tempJson);

                     if (this.infoData.exclusive == 'yszz') {
                        if (this.gameNumber <= 3) {
                           console.log('this.gameNumber', this.gameNumber)
                           this.infoData.huo_element -= 5;
                           this.infoData.bing_element -= 5;
                           this.infoData.dian_element -= 5;
                           this.infoData.du_element -= 5;
                           this.infoData.shui_element -= 5;
                        }
                     }
                     if (this.infoData2.skillAttr && this.infoData2.skillname) {
                        this.echoResult2();
                     } else {
                        this.echoResult();
                     }
                  } else {
                     this.gameNumber2 += 1;
                     if (this.infoData2.isWl > 0) {
                        var lianji = Math.floor(Math.random() * 100 + 1) <= this.infoData2.isWl ? true :
                           false; //暴击随机数判断
                        if (lianji) {
                           let sh = this.hurtRulst(this.infoData2, this.infoData);
                           this.infoData.qixieHide -= sh;
                           let sxNumber = 0;
                           if (this.infoData2.leech > 0) {
                              sxNumber = Math.round(sh * this.infoData2.leech / 100);
                              this.infoData2.qixieHide += sxNumber;
                              this.infoData2.qixieHide = this.infoData2.qixieHide > oldQixue2 ? oldQixue2 : this
                                 .infoData2.qixieHide;
                           }
                           let tempJson = {
                              baoji: 0,
                              wulian: 0,
                              skillname: this.infoData2.skillname ? this.infoData2.skillname : '普攻',
                              name1: this.infoData2.rename,
                              name2: this.infoData.rename,
                              sh: sh,
                              sm: this.infoData.qixieHide < 0 ? 0 : this.infoData.qixieHide
                           };
                           if (this.infoData2.leech) {
                              tempJson.leech = sxNumber;
                              tempJson.smz = this.infoData2.qixieHide;
                           }
                           if (isCrit) {
                              tempJson.baoji = 1;
                           }
                           if (isBlock) {
                              tempJson.block = 1;
                           }
                           if (this.infoData2.holyPressure > 0 && this.infoData.reborn > 0) {
                              tempJson.holyPressure = 1;
                           }
                           this.details.push(tempJson);
                           if (this.infoData.qixieHide <= 0 && this.infoData.reborn > 0) {
                              if (this.infoData2.holyPressure > 0) {
                                 this.infoData.qixieHide = oldQixue1;
                                 this.infoData2.qixieHide = oldQixue2;

                              } else {
                                 this.isReborn(this.infoData, this.infoData2, 1);
                              }
                              return false;
                           } else if (this.infoData.qixieHide <= 0) {
                              this.infoData.qixieHide = oldQixue1;
                              this.infoData2.qixieHide = oldQixue2;
                              return false;
                           }
                        }
                     }
                     let sh = this.hurtRulst(this.infoData2, this.infoData);
                     let sxNumber = 0;
                     if (this.infoData2.leech > 0) {
                        sxNumber = Math.round(sh * this.infoData2.leech / 100);
                        this.infoData2.qixieHide += sxNumber;
                        this.infoData2.qixieHide = this.infoData2.qixieHide > oldQixue2 ? oldQixue2 : this
                           .infoData2.qixieHide;
                     }
                     this.infoData.qixieHide -= sh;
                     let tempJson = {
                        baoji: 0,
                        wulian: 0,
                        skillname: this.infoData2.skillname ? this.infoData2.skillname : '普攻',
                        name1: this.infoData2.rename,
                        name2: this.infoData.rename,
                        sh: sh,
                        sm: this.infoData.qixieHide < 0 ? 0 : this.infoData.qixieHide
                     }
                     if (this.infoData2.leech) {
                        tempJson.leech = sxNumber;
                        tempJson.smz = this.infoData2.qixieHide;
                     }
                     if (isCrit) {
                        tempJson.baoji = 1;
                     }
                     if (lianji) {
                        tempJson.wulian = 1;
                     }
                     if (isBlock) {
                        tempJson.block = 1;
                     }
                     if (this.infoData2.holyPressure > 0 && this.infoData.reborn > 0) {
                        tempJson.holyPressure = 1;
                     }
                     isAttack = true;
                     this.details.push(tempJson);
                     if (this.infoData2.exclusive == 'yszz') {
                        if (this.gameNumber2 <= 3) {
                           this.infoData2.huo_element -= 5;
                           this.infoData2.bing_element -= 5;
                           this.infoData2.dian_element -= 5;
                           this.infoData2.du_element -= 5;
                           this.infoData2.shui_element -= 5;
                        }
                     }
                     if (this.infoData.skillAttr && this.infoData.skillname) {
                        this.echoResult2();
                     } else {
                        this.echoResult();
                     }
                  }
               } else {
                  if (this.infoData.exclusive == 'yszz') {
                     var number = Math.ceil(this.gameNumber);
                     number = number > 3 ? 3 : number;
                     console.log('number', number);
                     this.infoData.huo_element += 5 * number;
                     this.infoData.bing_element += 5 * number;
                     this.infoData.dian_element += 5 * number;
                     this.infoData.du_element += 5 * number;
                     this.infoData.shui_element += 5 * number;
                  }
                  if (this.infoData2.exclusive == 'yszz') {
                     var number = Math.ceil(this.gameNumber2);
                     number = number > 3 ? 3 : number;
                     this.infoData2.huo_element += 5 * number;
                     this.infoData2.bing_element += 5 * number;
                     this.infoData2.dian_element += 5 * number;
                     this.infoData2.du_element += 5 * number;
                     this.infoData2.shui_element += 5 * number;
                  }
                  if (this.infoData.qixieHide <= 0 && this.infoData.reborn > 0) {
                     if (this.infoData2.holyPressure > 0) {
                        this.infoData.qixieHide = oldQixue1;
                        this.infoData2.qixieHide = oldQixue2;
                        this.details[this.details.length - 1].noReborn = true;
                     } else {
                        this.isReborn(this.infoData, this.infoData2, 1);
                     }
                  } else if (this.infoData2.qixieHide <= 0 && this.infoData2.reborn > 0) {
                     if (this.infoData.holyPressure > 0) {
                        this.infoData.qixieHide = oldQixue1;
                        this.infoData2.qixieHide = oldQixue2;
                        this.details[this.details.length - 1].noReborn = true;
                     } else {
                        this.isReborn(this.infoData2, this.infoData, 1);
                     }
                  } else {
                     this.infoData.qixieHide = oldQixue1;
                     this.infoData2.qixieHide = oldQixue2;
                  }
               }
            },
            //法术对局详情
            echoResult2() {
               if (this.infoData.qixieHide > 0 && this.infoData2.qixieHide > 0) {
                  if (isAttack) {
                     this.gameNumber += 1;
                     if (this.infoData.isFl > 0) {
                        var lianji = Math.floor(Math.random() * 100 + 1) <= this.infoData.isFl ? true :
                           false; //暴击随机数判断
                        if (lianji) {
                           let sh = this.hurtRulst2(this.infoData, this.infoData2);
                           this.infoData2.qixieHide -= sh;
                           let tempJson = {
                              baoji: 0,
                              wulian: 0,
                              skillname: this.infoData.skillname ? this.infoData.skillname : '普攻',
                              name1: this.infoData.rename,
                              name2: this.infoData2.rename,
                              sh: sh,
                              sm: this.infoData2.qixieHide
                           };
                           if (isCrit) {
                              tempJson.baoji = 1;
                           }
                           if (this.infoData.holyPressure > 0 && this.infoData2.reborn > 0) {
                              tempJson.holyPressure = 1;
                           }
                           this.details.push(tempJson);
                           if (this.infoData2.qixieHide <= 0 && this.infoData2.reborn > 0) {
                              if (this.infoData.holyPressure > 0) {
                                 this.infoData.qixieHide = oldQixue1;
                                 this.infoData2.qixieHide = oldQixue2;
                                 this.details[this.details.length - 1].noReborn = true;
                              } else {
                                 this.isReborn(this.infoData2, this.infoData, 2);
                              }
                              return false;
                           } else if (this.infoData.qixieHide <= 0) {
                              this.infoData.qixieHide = oldQixue1;
                              this.infoData2.qixieHide = oldQixue2;
                              return false;
                           }
                        }
                     }
                     let sh = this.hurtRulst2(this.infoData, this.infoData2);
                     this.infoData2.qixieHide -= sh;
                     let tempJson = {
                        baoji: 0,
                        wulian: 0,
                        skillname: this.infoData.skillname ? this.infoData.skillname : '普攻',
                        name1: this.infoData.rename,
                        name2: this.infoData2.rename,
                        sh: sh,
                        sm: this.infoData2.qixieHide
                     };
                     if (isCrit) {
                        tempJson.baoji = 1;
                     }
                     if (lianji) {
                        tempJson.wulian = 1;
                     }
                     if (this.infoData.holyPressure > 0 && this.infoData2.reborn > 0) {
                        tempJson.holyPressure = 1;
                     }
                     isAttack = false;
                     this.details.push(tempJson);
                     if (this.infoData.exclusive == 'yszz') {
                        if (this.gameNumber <= 3) {
                           this.infoData.huo_element -= 5;
                           this.infoData.bing_element -= 5;
                           this.infoData.dian_element -= 5;
                           this.infoData.du_element -= 5;
                           this.infoData.shui_element -= 5;
                        }
                     }
                     if (this.infoData2.skillAttr && this.infoData2.skillname) {
                        console.log('进入1');
                        this.echoResult2();
                     } else {
                        this.echoResult();
                        console.log('进入2');
                     }
                  } else {
                     this.gameNumber2 += 1;
                     if (this.infoData2.isFl > 0) {
                        var lianji = Math.floor(Math.random() * 100 + 1) <= this.infoData.isFl ? true :
                           false; //暴击随机数判断
                        if (lianji) {
                           let sh = this.hurtRulst2(this.infoData2, this.infoData);
                           this.infoData.qixieHide -= sh;
                           let tempJson = {
                              baoji: 0,
                              wulian: 0,
                              skillname: this.infoData2.skillname ? this.infoData2.skillname : '普攻',
                              name1: this.infoData2.rename,
                              name2: this.infoData.rename,
                              sh: sh,
                              sm: this.infoData.qixieHide
                           };
                           if (isCrit) {
                              tempJson.baoji = 1;
                           }
                           if (this.infoData2.holyPressure > 0 && this.infoData.reborn > 0) {
                              tempJson.holyPressure = 1;
                           }
                           this.details.push(tempJson);
                           if (this.infoData.qixieHide <= 0 && this.infoData.reborn > 0) {
                              if (this.infoData2.holyPressure > 0) {
                                 this.infoData.qixieHide = oldQixue1;
                                 this.infoData2.qixieHide = oldQixue2;
                                 this.details[this.details.length - 1].noReborn = true;
                              } else {
                                 this.isReborn(this.infoData, this.infoData2, 2);
                              }
                              return false;
                           } else if (this.infoData.qixieHide <= 0) {
                              this.infoData.qixieHide = oldQixue1;
                              this.infoData2.qixieHide = oldQixue2;
                              return false;
                           }
                        }
                     }
                     let sh = this.hurtRulst2(this.infoData2, this.infoData);
                     this.infoData.qixieHide -= sh;
                     let tempJson = {
                        baoji: 0,
                        wulian: 0,
                        skillname: this.infoData2.skillname ? this.infoData2.skillname : '普攻',
                        name1: this.infoData2.rename,
                        name2: this.infoData.rename,
                        sh: sh,
                        sm: this.infoData.qixieHide
                     }
                     if (isCrit) {
                        tempJson.baoji = 1;
                     }
                     if (lianji) {
                        tempJson.wulian = 1;
                     }
                     if (this.infoData2.holyPressure > 0 && this.infoData.reborn > 0) {
                        tempJson.holyPressure = 1;
                     }
                     isAttack = true;
                     this.details.push(tempJson);
                     if (this.infoData2.exclusive == 'yszz') {
                        if (this.gameNumber2 <= 3) {
                           this.infoData2.huo_element -= 5;
                           this.infoData2.bing_element -= 5;
                           this.infoData2.dian_element -= 5;
                           this.infoData2.du_element -= 5;
                           this.infoData2.shui_element -= 5;
                        }
                     }
                     if (this.infoData.skillAttr && this.infoData.skillname) {
                        this.echoResult2();
                     } else {
                        this.echoResult();
                     }
                  }
               } else {
                  if (this.infoData.exclusive == 'yszz') {
                     var number = Math.ceil(this.gameNumber);
                     number = number > 3 ? 3 : number;
                     console.log('number', number);
                     this.infoData.huo_element += 5 * number;
                     this.infoData.bing_element += 5 * number;
                     this.infoData.dian_element += 5 * number;
                     this.infoData.du_element += 5 * number;
                     this.infoData.shui_element += 5 * number;
                  }
                  if (this.infoData2.exclusive == 'yszz') {
                     var number = Math.ceil(this.gameNumber2);
                     number = number > 3 ? 3 : number;
                     this.infoData2.huo_element += 5 * number;
                     this.infoData2.bing_element += 5 * number;
                     this.infoData2.dian_element += 5 * number;
                     this.infoData2.du_element += 5 * number;
                     this.infoData2.shui_element += 5 * number;
                  }
                  if (this.infoData.qixieHide <= 0 && this.infoData.reborn > 0) {
                     if (this.infoData2.holyPressure > 0) {
                        this.infoData.qixieHide = oldQixue1;
                        this.infoData2.qixieHide = oldQixue2;
                        this.details[this.details.length - 1].noReborn = true;
                     } else {
                        this.isReborn(this.infoData, this.infoData2, 2);
                     }
                  } else if (this.infoData2.qixieHide <= 0 && this.infoData2.reborn > 0) {
                     if (this.infoData.holyPressure > 0) {
                        this.infoData.qixieHide = oldQixue1;
                        this.infoData2.qixieHide = oldQixue2;
                        this.details[this.details.length - 1].noReborn = true;
                     } else {
                        this.isReborn(this.infoData2, this.infoData, 2);
                     }
                  } else {
                     this.infoData.qixieHide = oldQixue1;
                     this.infoData2.qixieHide = oldQixue2;
                  }
               }
            },
            // 是否重生判断
            isReborn(obj1, obj2, type = 1) {
               var reborn = Math.floor(Math.random() * 100 + 1) <= obj1.reborn ? true :
                  false; //暴击随机数判断
               if (reborn) {
                  obj1.qixieHide = oldQixue1 / Math.pow(2, rebornNumber1);
                  this.details[this.details.length - 1].reborn1 = true;
                  this.details[this.details.length - 1].cssm = obj1.qixieHide;
                  rebornNumber1 += 1;
                  if (type == 1) {
                     this.echoResult();
                  } else {
                     this.echoResult2();
                  }
               } else {
                  rebornNumber1 = 0;
                  obj1.qixieHide = oldQixue1;
                  obj2.qixieHide = oldQixue2;
                  return false;
               }
            },
            checkSkill() {
               console.log('ddd');
            },
            deleteSkill(item, index) {
               this.infoData2.skills.splice(index, 1);
               this.resetSillt();
            },
            resetSillt() {
               this.infoData2.sdUp = 0;
               this.infoData2.smUp = 0;
               this.infoData2.adUp = 0;
               this.infoData2.apUp = 0;
               this.infoData2.fqUp = 0;
               this.infoData2.wc = 0;
               this.infoData2.fc = 0;
               this.infoData2.elude = 0;
               this.infoData2.isWl = 0;
               this.infoData2.isFl = 0;
               this.infoData2.isSj = 0;
               this.infoData2.critWb = 2;
               this.infoData2.critFb = 2;
               this.infoData2.adImmune = 0;
               this.infoData2.apImmune = 0;
               this.infoData2.leech = 0;
               this.infoData2.reborn = 0;
               this.infoData2.isBlock = 0;
               this.infoData2.holyPressure = 0;
               this.infoData2.skillAttr = '';
               this.infoData2.skillname = '';
               this.infoData2.huo_element = huo_element;
               this.infoData2.bing_element = bing_element;
               this.infoData2.dian_element = dian_element;
               this.infoData2.du_element = du_element;
               this.infoData2.shui_element = shui_element;
               this.infoData2.skills.forEach((item, index) => {
                  if (item.upType == "sd") {
                     this.infoData2.sdUp += item.up;
                     this.infoData2.sdUp -= item.down;
                  } else if (item.upType == "sm") {
                     this.infoData2.smUp += item.up;
                     this.infoData2.elude += item.down;
                  } else if (item.upType == "sh") {
                     if (item.attr == 'ad') {
                        this.infoData2.adUp += item.up;
                        this.infoData2.apImmune -= item.down;
                     } else if (item.attr == 'ap') {
                        this.infoData2.apUp += item.up;
                     } else if (item.attr == 'all') {
                        this.infoData2.adUp += item.up;
                        this.infoData2.apUp += item.up;
                     }
                  } else if (item.upType == "wc") {
                     this.infoData2.wc += item.up;
                  } else if (item.upType == "bj") {
                     if (item.attr == 'wb') {
                        this.infoData2.critWb += item.up;
                     } else if (item.attr == 'fb') {
                        this.infoData2.critFb += item.up;
                     }
                  } else if (item.upType == "wl") {
                     this.infoData2.isWl = item.up;
                     this.infoData2.adUp -= item.down;
                  } else if (item.upType == "fl") {
                     this.infoData2.isFl = item.up;
                  } else if (item.upType == "jn") {
                     this.infoData2.skillAttr = item.attr;
                     this.infoData2.skillname = item.name;
                  } else if (item.upType == "sj") {
                     this.infoData2.isSj = item.upType;
                     this.infoData2.sjMin = -item.down;
                     this.infoData2.sjMax = item.up;
                  } else if (item.upType == "fc") {
                     this.infoData2.fc = item.up;
                  } else if (item.upType == "ts") {
                     if (item.attr == 'cs') {
                        this.infoData2.reborn = item.up;
                     } else if (item.attr == 'sx') {
                        this.infoData2.leech = item.up;
                     } else if (item.attr == 'sf') {
                        this.infoData2.adUp += item.up;
                        this.infoData2.apUp += item.up;
                        this.infoData2.holyPressure = item.down;
                     }
                  } else if (item.upType == 'fq') {
                     this.infoData2.fqUp = item.up;
                     this.infoData2.adImmune -= item.down;
                  } else if (item.upType == 'fy') { //防御
                     if (item.attr == 'ad') {
                        this.infoData2.adImmune += item.up;
                     } else if (item.attr == 'ap') {
                        this.infoData2.apImmune += item.up;
                     } else if (item.attr == 'gd') {
                        this.infoData2.isBlock = item.up;
                     }
                  } else if (item.upType == 'ys') { //防御
                     this.infoData2.skillAttr = item.attr;
                  } else if (item.upType == 'qh') { //防御
                     this.infoData2[item.attr] += item.up;
                  } else if (item.upType == 'zs') { //专属
                     if (item.attr == 'yszz') {
                        this.infoData2.huo_element += item.up;
                        this.infoData2.bing_element += item.up;
                        this.infoData2.dian_element += item.up;
                        this.infoData2.du_element += item.up;
                        this.infoData2.shui_element += item.up;
                     }
                  }
               })
               console.log(this.infoData2);
            },
            addSkill() {
               var _this = this;
               var html = `
                  <div class="skills_box">`;
               for (let var1 in skills) {
                  html += `
                     <div class="box_item" data-id="${var1}" data-name="${skills[var1].name}">
                        <img src=".${skills[var1].src}" alt="${skills[var1].name}">
                        <p>${skills[var1].name}</p>
                     </div>`;
               }
               html += `</div>`;
               var index = layer.open({
                  type: 1,
                  title: '技能',
                  area: ['530px', '300px'],
                  content: html //这里content是一个普通的String
               });
               $('.box_item').unbind().click(function() {
                  var name = $(this).attr('data-name');
                  var id = $(this).attr('data-id');
                  var addFlag = true;
                  _this.infoData2.skills.forEach((item, index) => {
                     if (item.name == name) {
                        addFlag = false;
                     }
                     if (_this.infoData2.skills.length >= _this.infoData2.skill + 2) {
                        addFlag = false;
                     }
                  })
                  if (addFlag) {
                     _this.infoData2.skills.push(skills[id]);
                     _this.resetSillt();
                  }
               })
            }
         },
         mounted() {
            document.querySelector('#app').classList.remove('hide');
         }
      })

      function getUrlParms(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
         var r = window.location.search.substr(1).match(reg);
         if (r != null)
            return unescape(r[2]);
         return null;
      }
   </script>
</html>
